<template>
  <n-modal v-if="!$cfg.mobile" v-model:show="val[mdname]">
    <n-card
      class="work_card"
      :class="popclass ?? ''"
      :content-style="popstyle ?? ''"
      preset="card"
      closable
      aria-modal="true"
      @close="val[mdname] = false"
    >
      <template #header>{{ text.title }}</template>
      <component :is="comp" :val="val" :ct="ct" />
    </n-card>
  </n-modal>

  <n-drawer v-else v-model:show="val[mdname]" class="work_drawer" placement="top">
    <n-drawer-content closable>
      <template #header>{{ text.title }}</template>
      <component :is="comp" :val="val" :ct="ct"  />
      <template #footer>
        <n-button @click="val[mdname] = false">关闭窗口</n-button>
      </template>
    </n-drawer-content>
  </n-drawer>
</template>

<script>

export default {
  mounted() {},
  props: {
    val: { required: true },
    ct: { required: true },
    text: { required: true },
    mdname: { required: true },
    comp: { required: true },
    popclass: { required: false },
    popstyle: { required: false },
  },
  setup(props) {
  },
};
</script>
